using AtomicCms.Common.Models;

namespace AtomicCms.Data.EntityFramework
{
    public static class EntityModelExtensions
    {
        public static Page CreatePage(this ac_Pages entityPage)
        {
            if (null == entityPage)
            {
                return default(Page);
            }

            var p = new Page {Id = entityPage.Id, PageTitle = entityPage.PageTitle, Alias = entityPage.Alias};
            return p;
        }

        public static Tag CreateTag(this ac_Tags acTags)
        {
            if (null == acTags)
            {
                return default(Tag);
            }

            var t = new Tag() {Id = acTags.TagId, Name = acTags.TagName};
            return t;
        }
    }
}